# coding:utf-8
# writingtime: 
# author:

import numpy as np
import matplotlib.pyplot as plt

colors = ['brown', 'orange', 'purple', 'olive', 'gray', 'pink', 'black', 'red', 'green', 'blue', 'cyan', 'm'
          ,'yellow','crimson','skyblue','teal','peru','tomato','wheat','darkgreen','lime']
markers = ['o', 's', 'd', 'p', 'h', 'x', 'v', '<', '.', '1', '*', '+',',','^','>','1','2','3','4','8','P','H']



# 两行一列
def f(li_x=None,value_list=None,label=None):
    #
    value_list=[
        [0.7269, 0.781, 0.7081, 0.6938, 0.6327]  ,
        [0.7305, 0.7855, 0.7118, 0.6971, 0.6359] ,
        [0.733, 0.7889, 0.7146, 0.6994, 0.6383]  ,
        [0.734, 0.7909, 0.7161, 0.7002, 0.6398]  ,
        [0.7332, 0.791, 0.7157, 0.6988, 0.64]
    ]

    flag=[[0,0],[0,1],[1,0],[1,1]]
    fig, axs = plt.subplots(2, 2,figsize=(12.5, 7.2))
    # plt.ylim((0, 5))
    for f in range(4):
        li=(np.array([0 for i in range(len(value_list[0]))]),np.array(value_list[f]))
        temp=np.array(li)
        axs[flag[f][0], flag[f][1]].errorbar([i+1 for i in range(len(value_list[0]))]
            ,[f+1 for i in range(len(value_list[0]))], yerr=temp, color=colors[f], ecolor=colors[f], elinewidth=3, linewidth=3)
        axs[flag[f][0], flag[f][1]].set_ylim((0, 5))
        # axs[flag[f][0], flag[f][1]].set_xlim((0.9, len(value_list[0])+0.1))
        # axs[flag[f][0], flag[f][1]].plot(li_x, value_list[f])
    plt.show()

# f()

'''
fig= plt.figure(constrained_layout=False, figsize=(12.5, 7.2))
# yticksName = ['1', '2', '3', '4', '5', '6', '7', '8']
# 设置刻度范围
plt.ylim((0, 8))
# 设置刻度名称
# plt.yticks([1, 2, 3, 4, 5, 6, 7, 8], yticksName)
# 设置误差大小
error_range = np.array([[0, 0, 0], [0, -1.1, 5]])
x = np.array([1.1, 3, 6])
y = np.array([2, 2, 2])
print(error_range)
# plt.errorbar(x,y,yerr=error_range,fmt='o:',ecolor='hotpink',elinewidth=3,ms=5,mfc='wheat',mec='salmon',capsize=3)
plt.errorbar(x, y, yerr=error_range, color='hotpink', ecolor='hotpink', elinewidth=3, ms=5, linewidth=3)
# plt.savefig('1.png')
# plt.grid()
plt.show()
'''

# a=np.array([0.1,0.4,0.2,0.8,0.3])
# # b=np.argsort(a)+1
# b=np.argsort(np.argsort(-a))+1
# print(b)

from collections import Counter
li=[2,3,2,2,2,6]
re=Counter(li).most_common(1)
print(re)

